home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
A-COMAL Series
/
(k)aac.d64
/
convert2.proc
< prev
next >
Wrap
Text File
|
2007-02-28
|
428b
|
19 lines
9010 PROC CONVERT(NUMBER,REF BASE#,REF RES$) CLOSED
9020 DIM STACK(80)
9030 SP:=1
9040 REPEAT
9050 TEMP:=NUMBER MOD BASE#
9060 NUMBER:=NUMBER DIV BASE#
9070 STACK(SP):=TEMP
9080 SP:+1
9090 UNTIL NUMBER=0
9100 FOR COUNT:=SP-1 TO 1 STEP -1 DO
9110 DIGIT:=STACK(COUNT)
9120 IF DIGIT<10 THEN
9130 RES$:=RES$+CHR$(DIGIT+ORD("0"))
9140 ELSE
9150 RES$:=RES$+CHR$(DIGIT-10+ORD("┴"))
9160 ENDIF
9170 ENDFOR COUNT
9180 ENDPROC CONVERT